<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::group(['prefix' => 'admin', 'namespace' => 'Admin'], function () {
    Route::match(['get', 'post'], '/', 'Index@login');
    Route::match(['get', 'post'], 'register', 'Index@register');
    Route::match(['get', 'post'], 'forget', 'Index@forget');
    Route::match(['post'], 'reset', 'Index@reset');
    Route::group(['middleware' => 'admin.login'], function () {
        Route::match(['get'], 'index', 'Home@index')->middleware('admin.login');
        Route::match(['post'], 'login_out', 'Home@login_out')->middleware('admin.login');
        Route::match(['get'], 'admin_list', 'Admin@admin_list')->middleware('admin.login');
        Route::match(['post'], 'admin_status', 'Admin@status')->middleware('admin.login');
        Route::match(['get', 'post'], 'admin_add', 'Admin@add')->middleware('admin.login');
        Route::match(['get', 'post'], 'admin_edit/{id?}', 'Admin@edit')->middleware('admin.login');
        Route::match(['post'], 'admin_del', 'Admin@del')->middleware('admin.login');
    });
});